{% extends 'base.html' %}
{% block content %}
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
  <legend>MySQL实例管理</legend>
</fieldset>
<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
  <ul class="layui-tab-title">
    <li class="layui-this">数据库基础信息</li>
    <li>数据库全局配置信息</li>
    <li>数据表查询</li>
  </ul>
  <div class="layui-tab-content" style="height: 100px;">
    <div class="layui-tab-item layui-show">
     <button class="layui-btn layui-btn-sm layui-btn-fluid" style="width: 80px" onclick="xadmin.open('新建db','{{ url_for('newdb') }}',400,400)"><i class="layui-icon"></i>新建库</button>
{#        <ul>#}
{#            {% for db in dbs %}#}
{#            <li>&nbsp;&nbsp;&nbsp;{{ db[0] }}</li>#}
{#            {% endfor %}#}
{#        </ul>#}
<table class="layui-table" style="background-color: whitesmoke">
    {% for db in dbs %}
    <tr>
        <td>{{ db[0] }}</td>
        <td><a href="{{ url_for('deldb',db=db[0]) }}">
            <i class="layui-icon">&#xe640;</i></a></td>
    </tr>
    {% endfor %}
</table>
    </div>
    <div class="layui-tab-item">
        <h3>&nbsp;&nbsp;数据库全局配置信息</h3><br>
{#        <ul>#}
{#            {% for conf in mconf %}#}
{#            <li>&nbsp;&nbsp;&nbsp;{{ conf[0] }}: &nbsp;&nbsp;<b>{{ conf[1] }}</b></li>#}
{#            {% endfor %}#}
{#        </ul>#}
{##优化，ul列表改为表格#}
<table class="layui-table" style="background-color: whitesmoke">
    {% for conf in mconf %}
    <tr>
        <td>{{ conf[0] }}</td>
        <td>{{ conf[1] }}</td>
    </tr>
    {% endfor %}
</table>
    </div>
    <div class="layui-tab-item">
        <form class="layui-form" action="/select" method="post">
            <div class="layui-inline">
            <label class="layui-form-label">选择库查表</label>
            <div class="layui-input-inline">
                <select name="modules" lay-verify="required" lay-search="">
                <option value="">直接选择或搜索选择</option>
                    {% for d in dbs %}
                <option value="{{ d[0] }}">{{ d[0] }}</option>
                    {% endfor %}
        </select>

      </div>
                 <input type="submit" value="提交">
    </div>
        </form>

        {% block content1 %}

        {% endblock %}

    </div>

  </div>
</div>
{% endblock %}

{% block js %}
  <style type="text/css">
      .tab1 {
          width: 300px;
          height: 300px;
          margin-top: 120px;
          margin-left: 380px;
          padding-top: 25px;
          border: 1px solid lightblue;
          background-color: whitesmoke;
      }
  </style>
{% endblock %}








